var mysqld = require('mysql');
const mysql = {
    host: 'localhost',
    user: 'root',
    password: '123456',
    // password: "Yingjie123456...",
    port: '3306',
    database: 'exam',
    dialect: 'mysql'
};
const pool = mysqld.createConnection({
    host: 'localhost',
    user: 'root',
    password: '123456',
    // password: "Yingjie123456...",
    port: '3306',
    database: 'exam',
    dialect: 'mysql'
});

const jwt = {
    secret: '123456'
};

// 配置session
const sessionConfig = {
    key:'koa:sess',
    maxAgeg: 1000*1,
    rolling:true,// 在每次请求时强行设置cookie，这将重置cookie过期时间 false 不重置  true 重置
};

module.exports = { mysql, jwt, sessionConfig, pool };   